Wordpress Migration from Localhost to Server

I was looking to build out a Wordpress sight locally and deploy the SQL + Wordpress files onto a remote server. There is a few steps involved to make sure login, links, and db all play nicely together after the transfer

Local Prep

  1. bundle wordpress files into a single zip folder. contents will look something like this wp-mynewsight-local.zip
wp-admin
wp-content
wp-includes
.htaccess
index.php
...
  1. Delete wp-config.php
  2. visit the local build's PHPMyAdmin app
  3. export the database
    1. method = quick
    2. format = SQL
    3. file will download as mynewsight-local_db.sql

Transfer to Server

I'm deploying this sight onto Bluehost.com so I had to create a fresh sight first, then transfer data onto it

upload Wordpress files

  1. Using CPanel, access the File Manager
  2. navigate to the server's new wordpress files. Example: public_html/mynewsight-com
  3. upload the wp-mynewsight-local.zip, unzip, and replace any matching file names
    ~~11. edit wp-config.php
    1. define('DB_NAME', 'mynewsight_db');
    2. define('DB_NAME', 'mynewsight_user');
    3. define('DB_NAME', 'super_strong_password');~~
  4. edit wp-config.php
  5. take note of the Table Prefix → example: S4B_
  6. change the table prefix to match your locally developed SQL file Table Prefix → example: wp_

edit database

  1. Login to Server's CPanel
  2. Launch MySQL® Databases
    ~~ 1. create new database → mynewsight_db
    2. create new user → mynewsight_user (with strong password)
    2. add new user to new database with all previleges~~
  3. Look inside to find the database with the matching table prefixes → S4B_
  4. add new user with same password from the local build's db. With all permissions enabled (my case admin_mynewsight)
  5. click the database and import the local db file db_mynewsight-local.sql
  6. edit wp_options
    1. siteurl = https://mynewsight.com
    2. home = https://mynewsight.com
  7. you can delete the old tables prefixed with S4B_. I just let them be
  8. visit your sight and login https://mynewsight.com/wp-admin
  9. fix all internal permalinks links via https://mynewsight.com/wp-admin/options-permalink.php and hit the button
  10. confirm Search Engine Visibility is set to off via https://mynewsight.com/wp-admin/options-reading.php

Credits